package com.atyun.properties;

import org.springframework.beans.factory.config.ConstructorArgumentValues;
import org.springframework.boot.context.properties.ConfigurationProperties;

import java.util.List;

/**
 * 读取配置文件的线程池配置类
 * @Author: 云水瑶
 * @Date: 2025/4/26
*/
@ConfigurationProperties(prefix = "dtp")
public class DtpProperties {

    private List<DtpExecutorProperties> executor;

    private DtpAlterProperties alter;

    public void setAlter(DtpAlterProperties alter) {
        this.alter = alter;
    }

    public DtpAlterProperties getAlter() {
        return this.alter;
    }

    public void setExecutor(List<DtpExecutorProperties> executor) {
        this.executor = executor;
    }

    public List<DtpExecutorProperties> getExecutor() {
        return this.executor;
    }

    public static class DtpAlterProperties {
        private String alterNotify;

        public void setAlterNotify(String alterNotify) {
            this.alterNotify = alterNotify;
        }

        public String getAlterNotify() {
            return this.alterNotify;
        }
    }

    public static class DtpExecutorProperties {
        private String poolName;

        private Integer corePoolSize = 10;

        private Integer maximumPoolSize = 20;

        private String alterNotify;

        public String getPoolName() {
            return this.poolName;
        }

        public void setPoolName(String poolName) {
            this.poolName = poolName;
        }

        public Integer getCorePoolSize() {
            return this.corePoolSize;
        }

        public void setCorePoolSize(Integer corePoolSize) {
            this.corePoolSize = corePoolSize;
        }

        public Integer getMaximumPoolSize() {
            return this.maximumPoolSize;
        }

        public void setMaximumPoolSize(Integer maximumPoolSize) {
            this.maximumPoolSize = maximumPoolSize;
        }

        public void setAlterNotify(String alterNotify) {
            this.alterNotify = alterNotify;
        }

        public String getAlterNotify() {
            return this.alterNotify;
        }
    }

}
